﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_CB_SHUIBIAOXX实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_CB_SHUIBIAOXX
    {
        private double? m_db_n_ysj;

        private decimal? m_dec_i_beiyong10;

        private decimal? m_dec_i_beiyong6;

        private decimal? m_dec_i_beiyong7;

        private decimal? m_dec_i_beiyong8;

        private decimal? m_dec_i_beiyong9;

        private decimal? m_dec_i_benyuecm;

        private decimal? m_dec_i_benyuesl;

        private decimal? m_dec_i_chaobiaozq;

        private decimal? m_dec_i_chaobiaozt;

        private decimal? m_dec_i_flag;

        private decimal? m_dec_i_gujics;

        private decimal? m_dec_i_jiaoduisl;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_koujing;

        private decimal? m_dec_i_leixing;

        private decimal? m_dec_i_m;

        private decimal? m_dec_i_no;

        private decimal? m_dec_i_shangyuecm;

        private decimal? m_dec_i_shangyuesl;

        private decimal? m_dec_i_type;

        private decimal? m_dec_i_y;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private DateTime? m_DT_d_chaobiao;

        private DateTime? m_DT_d_shangyue;

        private DateTime? m_DT_d_zhuangbiao;

        private string m_str_s_beiyong3;

        private string m_str_s_beiyong4;

        private string m_str_s_beiyong5;

        private string m_str_s_beizhu;

        private string m_str_s_biaoxing;

        private string m_str_s_caozuor;

        private string m_str_s_ch;

        private string m_str_s_chaobiaozt;

        private string m_str_s_dizhi;

        private string m_str_s_guanlikbh;

        private string m_str_s_jh;

        private string m_str_s_kuaihao;

        private string m_str_s_mingcheng;

        private string m_str_s_shuibiaobh;

        private string m_str_s_xiugair;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     自增量
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     站点编号
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     水表编号
        /// </summary>
        public string S_SHUIBIAOBH
        {
            get { return m_str_s_shuibiaobh; }
            set { m_str_s_shuibiaobh = value; }
        }

        /// <summary>
        ///     管理块编号
        /// </summary>
        public string S_GUANLIKBH
        {
            get { return m_str_s_guanlikbh; }
            set { m_str_s_guanlikbh = value; }
        }

        /// <summary>
        ///     水表序号
        /// </summary>
        public decimal? I_NO
        {
            get { return m_dec_i_no; }
            set { m_dec_i_no = value; }
        }

        /// <summary>
        ///     册号
        /// </summary>
        public string S_CH
        {
            get { return m_str_s_ch; }
            set { m_str_s_ch = value; }
        }

        /// <summary>
        ///     水表类型(0:自来水表;1:;2:冬灌表;3:夏灌表;4:常灌表)
        /// </summary>
        public decimal? I_TYPE
        {
            get { return m_dec_i_type; }
            set { m_dec_i_type = value; }
        }

        /// <summary>
        ///     水表地址
        /// </summary>
        public string S_DIZHI
        {
            get { return m_str_s_dizhi; }
            set { m_str_s_dizhi = value; }
        }

        /// <summary>
        ///     水表名称
        /// </summary>
        public string S_MINGCHENG
        {
            get { return m_str_s_mingcheng; }
            set { m_str_s_mingcheng = value; }
        }

        /// <summary>
        ///     口径
        /// </summary>
        public decimal? I_KOUJING
        {
            get { return m_dec_i_koujing; }
            set { m_dec_i_koujing = value; }
        }

        /// <summary>
        ///     表型
        /// </summary>
        public string S_BIAOXING
        {
            get { return m_str_s_biaoxing; }
            set { m_str_s_biaoxing = value; }
        }

        /// <summary>
        ///     块号
        /// </summary>
        public string S_KUAIHAO
        {
            get { return m_str_s_kuaihao; }
            set { m_str_s_kuaihao = value; }
        }

        /// <summary>
        ///     简号
        /// </summary>
        public string S_JH
        {
            get { return m_str_s_jh; }
            set { m_str_s_jh = value; }
        }

        /// <summary>
        ///     用水价
        /// </summary>
        public double? N_YSJ
        {
            get { return m_db_n_ysj; }
            set { m_db_n_ysj = value; }
        }

        /// <summary>
        ///     装表日期
        /// </summary>
        public DateTime? D_ZHUANGBIAO
        {
            get { return m_DT_d_zhuangbiao; }
            set { m_DT_d_zhuangbiao = value; }
        }

        /// <summary>
        ///     水量年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     水量月
        /// </summary>
        public decimal? I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     抄表周期
        /// </summary>
        public decimal? I_CHAOBIAOZQ
        {
            get { return m_dec_i_chaobiaozq; }
            set { m_dec_i_chaobiaozq = value; }
        }

        /// <summary>
        ///     上月抄码
        /// </summary>
        public decimal? I_SHANGYUECM
        {
            get { return m_dec_i_shangyuecm; }
            set { m_dec_i_shangyuecm = value; }
        }

        /// <summary>
        ///     上月抄表日期
        /// </summary>
        public DateTime? D_SHANGYUE
        {
            get { return m_DT_d_shangyue; }
            set { m_DT_d_shangyue = value; }
        }

        /// <summary>
        ///     上月水量
        /// </summary>
        public decimal? I_SHANGYUESL
        {
            get { return m_dec_i_shangyuesl; }
            set { m_dec_i_shangyuesl = value; }
        }

        /// <summary>
        ///     本月抄码
        /// </summary>
        public decimal? I_BENYUECM
        {
            get { return m_dec_i_benyuecm; }
            set { m_dec_i_benyuecm = value; }
        }

        /// <summary>
        ///     本月抄表日期
        /// </summary>
        public DateTime? D_CHAOBIAO
        {
            get { return m_DT_d_chaobiao; }
            set { m_DT_d_chaobiao = value; }
        }

        /// <summary>
        ///     本月水量
        /// </summary>
        public decimal? I_BENYUESL
        {
            get { return m_dec_i_benyuesl; }
            set { m_dec_i_benyuesl = value; }
        }

        /// <summary>
        ///     抄表状态
        /// </summary>
        public decimal? I_CHAOBIAOZT
        {
            get { return m_dec_i_chaobiaozt; }
            set { m_dec_i_chaobiaozt = value; }
        }

        /// <summary>
        ///     抄表状态名称
        /// </summary>
        public string S_CHAOBIAOZT
        {
            get { return m_str_s_chaobiaozt; }
            set { m_str_s_chaobiaozt = value; }
        }

        /// <summary>
        ///     估计次数
        /// </summary>
        public decimal? I_GUJICS
        {
            get { return m_dec_i_gujics; }
            set { m_dec_i_gujics = value; }
        }

        /// <summary>
        ///     校对水量
        /// </summary>
        public decimal? I_JIAODUISL
        {
            get { return m_dec_i_jiaoduisl; }
            set { m_dec_i_jiaoduisl = value; }
        }

        /// <summary>
        ///     水表状态
        /// </summary>
        public decimal? I_FLAG
        {
            get { return m_dec_i_flag; }
            set { m_dec_i_flag = value; }
        }

        /// <summary>
        ///     修改人编号
        /// </summary>
        public string S_XIUGAIR
        {
            get { return m_str_s_xiugair; }
            set { m_str_s_xiugair = value; }
        }

        /// <summary>
        ///     备注
        /// </summary>
        public string S_BEIZHU
        {
            get { return m_str_s_beizhu; }
            set { m_str_s_beizhu = value; }
        }

        /// <summary>
        ///     类型(0:本月;1:下月)
        /// </summary>
        public decimal? I_LEIXING
        {
            get { return m_dec_i_leixing; }
            set { m_dec_i_leixing = value; }
        }

        /// <summary>
        ///     记录状态(0:正常;-1:逻辑删除)
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     备用3
        /// </summary>
        public string S_BEIYONG3
        {
            get { return m_str_s_beiyong3; }
            set { m_str_s_beiyong3 = value; }
        }

        /// <summary>
        ///     备用4
        /// </summary>
        public string S_BEIYONG4
        {
            get { return m_str_s_beiyong4; }
            set { m_str_s_beiyong4 = value; }
        }

        /// <summary>
        ///     备用5
        /// </summary>
        public string S_BEIYONG5
        {
            get { return m_str_s_beiyong5; }
            set { m_str_s_beiyong5 = value; }
        }

        /// <summary>
        ///     备用6
        /// </summary>
        public decimal? I_BEIYONG6
        {
            get { return m_dec_i_beiyong6; }
            set { m_dec_i_beiyong6 = value; }
        }

        /// <summary>
        ///     备用7
        /// </summary>
        public decimal? I_BEIYONG7
        {
            get { return m_dec_i_beiyong7; }
            set { m_dec_i_beiyong7 = value; }
        }

        /// <summary>
        ///     备用8
        /// </summary>
        public decimal? I_BEIYONG8
        {
            get { return m_dec_i_beiyong8; }
            set { m_dec_i_beiyong8 = value; }
        }

        /// <summary>
        ///     备用9
        /// </summary>
        public decimal? I_BEIYONG9
        {
            get { return m_dec_i_beiyong9; }
            set { m_dec_i_beiyong9 = value; }
        }

        /// <summary>
        ///     备用10
        /// </summary>
        public decimal? I_BEIYONG10
        {
            get { return m_dec_i_beiyong10; }
            set { m_dec_i_beiyong10 = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_CB_SHUIBIAOXXProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_CB_SHUIBIAOXXProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_CB_SHUIBIAOXX实体添加或者修改YS_CB_SHUIBIAOXX信息
        /// </summary>
        public bool InsertOrUpdate(YS_CB_SHUIBIAOXX YS_CB_SHUIBIAOXX, OracleTransaction Transaction)
        {
            if (YS_CB_SHUIBIAOXX.ID == 0)
                InsertYS_CB_SHUIBIAOXX(YS_CB_SHUIBIAOXX, Transaction);
            else
                UpdateYS_CB_SHUIBIAOXX(YS_CB_SHUIBIAOXX, Transaction);
            return YS_CB_SHUIBIAOXX.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_CB_SHUIBIAOXX实体添加或修改YS_CB_SHUIBIAOXX信息
        /// </summary>
        public bool InsertOrUpdate(YS_CB_SHUIBIAOXX YS_CB_SHUIBIAOXX)
        {
            return InsertOrUpdate(YS_CB_SHUIBIAOXX, null);
        }


        /// <summary>
        ///     根据YS_CB_SHUIBIAOXX主键删除YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_CB_SHUIBIAOXX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_CB_SHUIBIAOXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_CB_SHUIBIAOXX主键删除YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_CB_SHUIBIAOXX(decimal ID)
        {
            return DeleteYS_CB_SHUIBIAOXX(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_CB_SHUIBIAOXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_CB_SHUIBIAOXXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_CB_SHUIBIAOXXesDynamic(string WhereClause)
        {
            return DeleteYS_CB_SHUIBIAOXXesDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_CB_SHUIBIAOXX主键选择YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_CB_SHUIBIAOXX信息</returns>
        public YS_CB_SHUIBIAOXX SelectYS_CB_SHUIBIAOXX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CB_SHUIBIAOXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_CB_SHUIBIAOXX = PopulateYS_CB_SHUIBIAOXX(rd);
                rd.Close();
                return YS_CB_SHUIBIAOXX;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_CB_SHUIBIAOXX主键选择YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <returns>YS_CB_SHUIBIAOXX信息</returns>
        public YS_CB_SHUIBIAOXX SelectYS_CB_SHUIBIAOXX(decimal ID)
        {
            return SelectYS_CB_SHUIBIAOXX(ID, null);
        }

        /// <summary>
        ///     选择所有YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_CB_SHUIBIAOXX信息</returns>
        public DataTable SelectYS_CB_SHUIBIAOXXesAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CB_SHUIBIAOXXesAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <returns>所有YS_CB_SHUIBIAOXX信息</returns>
        public DataTable SelectYS_CB_SHUIBIAOXXesAll()
        {
            return SelectYS_CB_SHUIBIAOXXesAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_CB_SHUIBIAOXX信息</returns>
        public DataTable SelectYS_CB_SHUIBIAOXXesDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CB_SHUIBIAOXXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_CB_SHUIBIAOXX信息</returns>
        public DataTable SelectYS_CB_SHUIBIAOXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_CB_SHUIBIAOXXesDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_CB_SHUIBIAOXX信息</returns>
        public DataTable SelectYS_CB_SHUIBIAOXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CB_SHUIBIAOXXesDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_CB_SHUIBIAOXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_CB_SHUIBIAOXX信息</returns>
        public DataTable SelectYS_CB_SHUIBIAOXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_CB_SHUIBIAOXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_CB_SHUIBIAOXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_CB_SHUIBIAOXXesDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_CB_SHUIBIAOXXDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_CB_SHUIBIAOXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_CB_SHUIBIAOXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_CB_SHUIBIAOXXesDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_CB_SHUIBIAOXX(YS_CB_SHUIBIAOXX YS_CB_SHUIBIAOXX, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_CB_SHUIBIAOXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_CB_SHUIBIAOXX.S_ZHANDIANBH;
            storedParams[1].Value = YS_CB_SHUIBIAOXX.S_SHUIBIAOBH;
            storedParams[2].Value = YS_CB_SHUIBIAOXX.S_GUANLIKBH;
            storedParams[3].Value = YS_CB_SHUIBIAOXX.I_NO;
            storedParams[4].Value = YS_CB_SHUIBIAOXX.S_CH;
            storedParams[5].Value = YS_CB_SHUIBIAOXX.I_TYPE;
            storedParams[6].Value = YS_CB_SHUIBIAOXX.S_DIZHI;
            storedParams[7].Value = YS_CB_SHUIBIAOXX.S_MINGCHENG;
            storedParams[8].Value = YS_CB_SHUIBIAOXX.I_KOUJING;
            storedParams[9].Value = YS_CB_SHUIBIAOXX.S_BIAOXING;
            storedParams[10].Value = YS_CB_SHUIBIAOXX.S_KUAIHAO;
            storedParams[11].Value = YS_CB_SHUIBIAOXX.S_JH;
            storedParams[12].Value = YS_CB_SHUIBIAOXX.N_YSJ;
            storedParams[13].Value = YS_CB_SHUIBIAOXX.D_ZHUANGBIAO;
            storedParams[14].Value = YS_CB_SHUIBIAOXX.I_Y;
            storedParams[15].Value = YS_CB_SHUIBIAOXX.I_M;
            storedParams[16].Value = YS_CB_SHUIBIAOXX.I_CHAOBIAOZQ;
            storedParams[17].Value = YS_CB_SHUIBIAOXX.I_SHANGYUECM;
            storedParams[18].Value = YS_CB_SHUIBIAOXX.D_SHANGYUE;
            storedParams[19].Value = YS_CB_SHUIBIAOXX.I_SHANGYUESL;
            storedParams[20].Value = YS_CB_SHUIBIAOXX.I_BENYUECM;
            storedParams[21].Value = YS_CB_SHUIBIAOXX.D_CHAOBIAO;
            storedParams[22].Value = YS_CB_SHUIBIAOXX.I_BENYUESL;
            storedParams[23].Value = YS_CB_SHUIBIAOXX.I_CHAOBIAOZT;
            storedParams[24].Value = YS_CB_SHUIBIAOXX.S_CHAOBIAOZT;
            storedParams[25].Value = YS_CB_SHUIBIAOXX.I_GUJICS;
            storedParams[26].Value = YS_CB_SHUIBIAOXX.I_JIAODUISL;
            storedParams[27].Value = YS_CB_SHUIBIAOXX.I_FLAG;
            storedParams[28].Value = YS_CB_SHUIBIAOXX.S_XIUGAIR;
            storedParams[29].Value = YS_CB_SHUIBIAOXX.S_BEIZHU;
            storedParams[30].Value = YS_CB_SHUIBIAOXX.I_LEIXING;
            storedParams[31].Value = YS_CB_SHUIBIAOXX.I_JLZT;
            storedParams[32].Value = YS_CB_SHUIBIAOXX.D_CAOZUOSJ;
            storedParams[33].Value = YS_CB_SHUIBIAOXX.S_CAOZUOR;
            storedParams[34].Value = YS_CB_SHUIBIAOXX.S_BEIYONG3;
            storedParams[35].Value = YS_CB_SHUIBIAOXX.S_BEIYONG4;
            storedParams[36].Value = YS_CB_SHUIBIAOXX.S_BEIYONG5;
            storedParams[37].Value = YS_CB_SHUIBIAOXX.I_BEIYONG6;
            storedParams[38].Value = YS_CB_SHUIBIAOXX.I_BEIYONG7;
            storedParams[39].Value = YS_CB_SHUIBIAOXX.I_BEIYONG8;
            storedParams[40].Value = YS_CB_SHUIBIAOXX.I_BEIYONG9;
            storedParams[41].Value = YS_CB_SHUIBIAOXX.I_BEIYONG10;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_CB_SHUIBIAOXX.ID = Convert.ToInt32(storedParams[42].Value);
            return result;
        }

        private bool UpdateYS_CB_SHUIBIAOXX(YS_CB_SHUIBIAOXX YS_CB_SHUIBIAOXX, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_CB_SHUIBIAOXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_CB_SHUIBIAOXX.S_ZHANDIANBH;
            storedParams[1].Value = YS_CB_SHUIBIAOXX.S_SHUIBIAOBH;
            storedParams[2].Value = YS_CB_SHUIBIAOXX.S_GUANLIKBH;
            storedParams[3].Value = YS_CB_SHUIBIAOXX.I_NO;
            storedParams[4].Value = YS_CB_SHUIBIAOXX.S_CH;
            storedParams[5].Value = YS_CB_SHUIBIAOXX.I_TYPE;
            storedParams[6].Value = YS_CB_SHUIBIAOXX.S_DIZHI;
            storedParams[7].Value = YS_CB_SHUIBIAOXX.S_MINGCHENG;
            storedParams[8].Value = YS_CB_SHUIBIAOXX.I_KOUJING;
            storedParams[9].Value = YS_CB_SHUIBIAOXX.S_BIAOXING;
            storedParams[10].Value = YS_CB_SHUIBIAOXX.S_KUAIHAO;
            storedParams[11].Value = YS_CB_SHUIBIAOXX.S_JH;
            storedParams[12].Value = YS_CB_SHUIBIAOXX.N_YSJ;
            storedParams[13].Value = YS_CB_SHUIBIAOXX.D_ZHUANGBIAO;
            storedParams[14].Value = YS_CB_SHUIBIAOXX.I_Y;
            storedParams[15].Value = YS_CB_SHUIBIAOXX.I_M;
            storedParams[16].Value = YS_CB_SHUIBIAOXX.I_CHAOBIAOZQ;
            storedParams[17].Value = YS_CB_SHUIBIAOXX.I_SHANGYUECM;
            storedParams[18].Value = YS_CB_SHUIBIAOXX.D_SHANGYUE;
            storedParams[19].Value = YS_CB_SHUIBIAOXX.I_SHANGYUESL;
            storedParams[20].Value = YS_CB_SHUIBIAOXX.I_BENYUECM;
            storedParams[21].Value = YS_CB_SHUIBIAOXX.D_CHAOBIAO;
            storedParams[22].Value = YS_CB_SHUIBIAOXX.I_BENYUESL;
            storedParams[23].Value = YS_CB_SHUIBIAOXX.I_CHAOBIAOZT;
            storedParams[24].Value = YS_CB_SHUIBIAOXX.S_CHAOBIAOZT;
            storedParams[25].Value = YS_CB_SHUIBIAOXX.I_GUJICS;
            storedParams[26].Value = YS_CB_SHUIBIAOXX.I_JIAODUISL;
            storedParams[27].Value = YS_CB_SHUIBIAOXX.I_FLAG;
            storedParams[28].Value = YS_CB_SHUIBIAOXX.S_XIUGAIR;
            storedParams[29].Value = YS_CB_SHUIBIAOXX.S_BEIZHU;
            storedParams[30].Value = YS_CB_SHUIBIAOXX.I_LEIXING;
            storedParams[31].Value = YS_CB_SHUIBIAOXX.I_JLZT;
            storedParams[32].Value = YS_CB_SHUIBIAOXX.D_CAOZUOSJ;
            storedParams[33].Value = YS_CB_SHUIBIAOXX.S_CAOZUOR;
            storedParams[34].Value = YS_CB_SHUIBIAOXX.S_BEIYONG3;
            storedParams[35].Value = YS_CB_SHUIBIAOXX.S_BEIYONG4;
            storedParams[36].Value = YS_CB_SHUIBIAOXX.S_BEIYONG5;
            storedParams[37].Value = YS_CB_SHUIBIAOXX.I_BEIYONG6;
            storedParams[38].Value = YS_CB_SHUIBIAOXX.I_BEIYONG7;
            storedParams[39].Value = YS_CB_SHUIBIAOXX.I_BEIYONG8;
            storedParams[40].Value = YS_CB_SHUIBIAOXX.I_BEIYONG9;
            storedParams[41].Value = YS_CB_SHUIBIAOXX.I_BEIYONG10;
            storedParams[42].Value = YS_CB_SHUIBIAOXX.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_CB_SHUIBIAOXX PopulateYS_CB_SHUIBIAOXX(IDataReader dr)
        {
            var YS_CB_SHUIBIAOXX = new YS_CB_SHUIBIAOXX();
            YS_CB_SHUIBIAOXX.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_CB_SHUIBIAOXX.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string) dr["S_ZHANDIANBH"];
            YS_CB_SHUIBIAOXX.S_SHUIBIAOBH = dr["S_SHUIBIAOBH"] == DBNull.Value ? null : (string) dr["S_SHUIBIAOBH"];
            YS_CB_SHUIBIAOXX.S_GUANLIKBH = dr["S_GUANLIKBH"] == DBNull.Value ? null : (string) dr["S_GUANLIKBH"];
            YS_CB_SHUIBIAOXX.I_NO = dr["I_NO"] == DBNull.Value ? null : (decimal?) dr["I_NO"];
            YS_CB_SHUIBIAOXX.S_CH = dr["S_CH"] == DBNull.Value ? null : (string) dr["S_CH"];
            YS_CB_SHUIBIAOXX.I_TYPE = dr["I_TYPE"] == DBNull.Value ? null : (decimal?) dr["I_TYPE"];
            YS_CB_SHUIBIAOXX.S_DIZHI = dr["S_DIZHI"] == DBNull.Value ? null : (string) dr["S_DIZHI"];
            YS_CB_SHUIBIAOXX.S_MINGCHENG = dr["S_MINGCHENG"] == DBNull.Value ? null : (string) dr["S_MINGCHENG"];
            YS_CB_SHUIBIAOXX.I_KOUJING = dr["I_KOUJING"] == DBNull.Value ? null : (decimal?) dr["I_KOUJING"];
            YS_CB_SHUIBIAOXX.S_BIAOXING = dr["S_BIAOXING"] == DBNull.Value ? null : (string) dr["S_BIAOXING"];
            YS_CB_SHUIBIAOXX.S_KUAIHAO = dr["S_KUAIHAO"] == DBNull.Value ? null : (string) dr["S_KUAIHAO"];
            YS_CB_SHUIBIAOXX.S_JH = dr["S_JH"] == DBNull.Value ? null : (string) dr["S_JH"];
            YS_CB_SHUIBIAOXX.N_YSJ = dr["N_YSJ"] == DBNull.Value ? null : (double?) dr["N_YSJ"];
            YS_CB_SHUIBIAOXX.D_ZHUANGBIAO = dr["D_ZHUANGBIAO"] == DBNull.Value ? null : (DateTime?) dr["D_ZHUANGBIAO"];
            YS_CB_SHUIBIAOXX.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            YS_CB_SHUIBIAOXX.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?) dr["I_M"];
            YS_CB_SHUIBIAOXX.I_CHAOBIAOZQ = dr["I_CHAOBIAOZQ"] == DBNull.Value ? null : (decimal?) dr["I_CHAOBIAOZQ"];
            YS_CB_SHUIBIAOXX.I_SHANGYUECM = dr["I_SHANGYUECM"] == DBNull.Value ? null : (decimal?) dr["I_SHANGYUECM"];
            YS_CB_SHUIBIAOXX.D_SHANGYUE = dr["D_SHANGYUE"] == DBNull.Value ? null : (DateTime?) dr["D_SHANGYUE"];
            YS_CB_SHUIBIAOXX.I_SHANGYUESL = dr["I_SHANGYUESL"] == DBNull.Value ? null : (decimal?) dr["I_SHANGYUESL"];
            YS_CB_SHUIBIAOXX.I_BENYUECM = dr["I_BENYUECM"] == DBNull.Value ? null : (decimal?) dr["I_BENYUECM"];
            YS_CB_SHUIBIAOXX.D_CHAOBIAO = dr["D_CHAOBIAO"] == DBNull.Value ? null : (DateTime?) dr["D_CHAOBIAO"];
            YS_CB_SHUIBIAOXX.I_BENYUESL = dr["I_BENYUESL"] == DBNull.Value ? null : (decimal?) dr["I_BENYUESL"];
            YS_CB_SHUIBIAOXX.I_CHAOBIAOZT = dr["I_CHAOBIAOZT"] == DBNull.Value ? null : (decimal?) dr["I_CHAOBIAOZT"];
            YS_CB_SHUIBIAOXX.S_CHAOBIAOZT = dr["S_CHAOBIAOZT"] == DBNull.Value ? null : (string) dr["S_CHAOBIAOZT"];
            YS_CB_SHUIBIAOXX.I_GUJICS = dr["I_GUJICS"] == DBNull.Value ? null : (decimal?) dr["I_GUJICS"];
            YS_CB_SHUIBIAOXX.I_JIAODUISL = dr["I_JIAODUISL"] == DBNull.Value ? null : (decimal?) dr["I_JIAODUISL"];
            YS_CB_SHUIBIAOXX.I_FLAG = dr["I_FLAG"] == DBNull.Value ? null : (decimal?) dr["I_FLAG"];
            YS_CB_SHUIBIAOXX.S_XIUGAIR = dr["S_XIUGAIR"] == DBNull.Value ? null : (string) dr["S_XIUGAIR"];
            YS_CB_SHUIBIAOXX.S_BEIZHU = dr["S_BEIZHU"] == DBNull.Value ? null : (string) dr["S_BEIZHU"];
            YS_CB_SHUIBIAOXX.I_LEIXING = dr["I_LEIXING"] == DBNull.Value ? null : (decimal?) dr["I_LEIXING"];
            YS_CB_SHUIBIAOXX.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_CB_SHUIBIAOXX.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            YS_CB_SHUIBIAOXX.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_CB_SHUIBIAOXX.S_BEIYONG3 = dr["S_BEIYONG3"] == DBNull.Value ? null : (string) dr["S_BEIYONG3"];
            YS_CB_SHUIBIAOXX.S_BEIYONG4 = dr["S_BEIYONG4"] == DBNull.Value ? null : (string) dr["S_BEIYONG4"];
            YS_CB_SHUIBIAOXX.S_BEIYONG5 = dr["S_BEIYONG5"] == DBNull.Value ? null : (string) dr["S_BEIYONG5"];
            YS_CB_SHUIBIAOXX.I_BEIYONG6 = dr["I_BEIYONG6"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG6"];
            YS_CB_SHUIBIAOXX.I_BEIYONG7 = dr["I_BEIYONG7"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG7"];
            YS_CB_SHUIBIAOXX.I_BEIYONG8 = dr["I_BEIYONG8"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG8"];
            YS_CB_SHUIBIAOXX.I_BEIYONG9 = dr["I_BEIYONG9"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG9"];
            YS_CB_SHUIBIAOXX.I_BEIYONG10 = dr["I_BEIYONG10"] == DBNull.Value ? null : (decimal?) dr["I_BEIYONG10"];
            return YS_CB_SHUIBIAOXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion